<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //1、undefined为false
        console.log(!!window.abc);  //!!将数据转换成boolean类型

        //2、null为false
        console.log(!!null);

        //3、+0,-0,0,0.0,NaN为false
        console.log(!!+0);
        console.log(!!-0);
        console.log(!!0);
        console.log(!!0.0);
        console.log(!!NaN);

        //4、字符串空为false
        console.log(!!"");  //false
        console.log(!!"  ");  //true
    </script>
</body>

</html>